package com.ruoyi.common.enums;

/**
 * 用户状态
 *
 * @author ruoyi
 */
public enum WorkStatus {
    // 1无业，2失业，3待业，4正常
    WY(1L, "无业"),
    SY(2L, "失业"),
    DY(3L, "待业"),
    ZC(4L, "正常");

    private final Long code;
    private final String name;

    public static String getNameByCode(Long code){
        for (WorkStatus workStatus : WorkStatus.values()) {
            if (code.equals(workStatus.code)){
                return workStatus.name;
            }
        }
        return "";
    }

    WorkStatus(Long code, String info) {
        this.code = code;
        this.name = info;
    }

    public Long getCode() {
        return code;
    }

    public String getName() {
        return name;
    }
}
